/**
 * 
 */
package jmine.tec.web.wicket.model;

import org.apache.wicket.model.IModel;

/**
 * IModel padrao mas que "larga" o objeto no detach
 * 
 * @author takeshi
 * @param <E> o tipo
 */
public class DefaultDetachableModel<E> implements IModel<E> {

    private E value;

    /**
     * @param object E
     */
    public DefaultDetachableModel(E object) {
        this.value = object;
    }

    /**
     * {@inheritDoc}
     */
    public E getObject() {
        return this.value;
    }

    /**
     * {@inheritDoc}
     */
    public void setObject(E object) {
        this.value = object;
    }

    /**
     * {@inheritDoc}
     */
    public void detach() {
        this.value = null;
    }
}